/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.dp.vo;

import java.io.Serializable;

import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author wyr
 */
@Entity
@Table(name = "song_rbt_song")
//@NamedQueries({@NamedQuery(name = "SongRbtSong.findAll", query = "SELECT s FROM SongRbtSong s"), @NamedQuery(name = "SongRbtSong.findBySongId", query = "SELECT s FROM SongRbtSong s WHERE s.songRbtSongPK.songId = :songId"), @NamedQuery(name = "SongRbtSong.findByRBTId", query = "SELECT s FROM SongRbtSong s WHERE s.songRbtSongPK.rBTId = :rBTId")})
public class SongRbtSong implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected SongRbtSongPK songRbtSongPK;

    public SongRbtSong() {
    }

    public SongRbtSong(SongRbtSongPK songRbtSongPK) {
        this.songRbtSongPK = songRbtSongPK;
    }

    public SongRbtSong(int songId, int rBTId) {
        this.songRbtSongPK = new SongRbtSongPK(songId, rBTId);
    }

    public SongRbtSongPK getSongRbtSongPK() {
        return songRbtSongPK;
    }

    public void setSongRbtSongPK(SongRbtSongPK songRbtSongPK) {
        this.songRbtSongPK = songRbtSongPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (songRbtSongPK != null ? songRbtSongPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SongRbtSong)) {
            return false;
        }
        SongRbtSong other = (SongRbtSong) object;
        if ((this.songRbtSongPK == null && other.songRbtSongPK != null) || (this.songRbtSongPK != null && !this.songRbtSongPK.equals(other.songRbtSongPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dp.vo.SongRbtSong[songRbtSongPK=" + songRbtSongPK + "]";
    }

}
